package com.dfbz.demo02_缓存字符流;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo02_BufferedReader {

    public static void main(String[] args) throws Exception {


        // 缓存字符输入流
        BufferedReader br = new BufferedReader(new FileReader("001.txt"));

        String line;

        while ((line = br.readLine()) != null) {
            System.out.println(line);
        }

        br.close();
    }

    public static void test(String[] args) throws Exception {

        // 缓存字符输入流
        BufferedReader br = new BufferedReader(new FileReader("001.txt"));

        String line = br.readLine();
        System.out.println(line);

        line = br.readLine();
        System.out.println(line);

        line = br.readLine();
        System.out.println(line);

        line = br.readLine();
        System.out.println(line);

        line = br.readLine();
        System.out.println(line);

        br.close();
    }


}
